<?
include_once "gblinclude.lib";

global $gblDBConnect;

$toUserId = $_GET["to_user_id"];
$fromUserId = $_GET["from_user_id"];
$message = $_POST["message"];
$msgType = $_GET["msg_type"];


$msgId = GetNextObjID("Message");

$sql = "INSERT INTO tc_shop_game_news (msg_id, recv_user_id, send_user_id, message_text, message_type, send_time)
		VALUES (".$msgId.", ".$toUserId.", ".$fromUserId.", '".$message."', ".$msgType.", ".ConvertToDbDateByString("CURRENT").")";
	
$resObj = new CDataObject();
try
{
	$res = $gblDBConnect->execute($sql);
	$resObj->success = true;
}
catch(Exception $ex)
{
	$resObj->success = false;
	LogError("PDO ERR [Save Message Fucntion]  ___ ".$ex->getMessage());
	LogError("SQL  ___ ".$sql);
}
	
echo json_encode($resObj);
exit;

?>
